#ifndef __STORMWIDGET_STORMWIDGET_UILIBRARY_CPROGRESSBARUI_PROGRESSBARUI_H
#define __STORMWIDGET_STORMWIDGET_UILIBRARY_CPROGRESSBARUI_PROGRESSBARUI_H

#include "ControlUI.h"

class IProgressBarCallbackUI
{
public:
	virtual int GetProgressPos() = 0;
};

class CProgressBarUI: public CControlUI
{
public:
	CProgressBarUI(void);
	virtual ~CProgressBarUI(void);
	CStdString GetName() const;
	LPCTSTR GetClass() const;
	UINT GetControlFlags() const;
	SIZE EstimateSize(SIZE szAvailable);
	void DoPaint(HDC hDC, const RECT& rcPaint);
	int GetPos();
	void SetRange(int nRange);
	void SetCallBack(IProgressBarCallbackUI* pCallback);
	virtual void SetPos(RECT rc);
protected:
	void LoadProgressImg();
private:
	SIZE m_szPadding;
	HBITMAP m_hBitmap;
	BITMAP m_BitmapInfo;
	RECT m_rcProcess;
	int m_nPos;
	int m_nRange;
	IProgressBarCallbackUI* m_pCallback;
	bool m_bIsInit;

};

#endif //__STORMWIDGET_STORMWIDGET_UILIBRARY_CPROGRESSBARUI_PROGRESSBARUI_H
